package com.wenlin.myproduction.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author 文琳
 * @Email 377979485@qq.com
 * @desc
 * @time 2022-09-03 星期六 13:34
 */
public class GameOption implements Parcelable {
    private String name;
    private String type;
    private boolean selected;

    public GameOption(String name, String type) {
        this.name = name;
        this.type = type;
    }

    public GameOption(String name, boolean selected) {
        this.name = name;
        this.selected = selected;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.type);
        dest.writeByte(this.selected ? (byte) 1 : (byte) 0);
    }

    protected GameOption(Parcel in) {
        this.name = in.readString();
        this.type = in.readString();
        this.selected = in.readByte() != 0;
    }

    public static final Creator<GameOption> CREATOR = new Creator<GameOption>() {
        @Override
        public GameOption createFromParcel(Parcel source) {
            return new GameOption(source);
        }

        @Override
        public GameOption[] newArray(int size) {
            return new GameOption[size];
        }
    };
}
